A database can hold a tremendous amount of information. At any given time, a user will only want to see a subset of that information. Users select that subset by defining a query, which is a piece of text written in a query specification language, such as SQL. But because query specification languages are complex, they are typically not appropriate for end users. For end users, there are simpler languages such as chunk expression languages or simple full-text searching. Some simplified query languages are not expressive enough for users to develop queries with adequate refinements to access information from a database. Simplified query languages that are expressive enough are often as difficult to learn as a query specification language, and so are inappropriate for end users. Text searches are too inaccurate and return too many unrelated results to be useful.
Accordingly, the present invention provides a database query user interface that that combines the user convenience of simple text searching with the expressive refinements of powerful query languages. In one implementation, a database query user interface includes a query text string input from a user. The query text string has one or more terms of a chunk expression language format. A chunk expression language format is a pseudo-natural language (e.g., English-like, or like any other human language) that can be easily parsed by a computer into a formal query specification language, such as SQL. Simple chunk expressions were developed as early as 1986 in the HyperCard project of Apple Corporation. The SK8 authoring tool, also developed by Apple Corporation, provided a complete chunk expression language by 1988.
The database query user interface of the present invention further includes a syntactical prompt for constructing a multi-element chunk expression language database query that is syntactically correct and complete and includes the text string input from the user. For example, the syntactical prompt is selected from the database based upon a weighted analysis of database information relating to database elements included in the text string input from the user.
A database query formed according to the present user interface may then be persisted or stored as a database query object. Such an object allows a query to be refined, such as by a user adding or deleting items in a set of results returned by the query. Such additions or deletions, which are referred to as exceptions, may be stored with the query as a data structure. In some implementations, a revised database query in the chunk expression language format can be generated automatically to incorporate exceptions in the exception list, thereby refining the query and reducing resource requirements for maintaining and implementing the separate exceptions. The present invention provides, therefore, a database query user interface that combines the user convenience of conventional simple search languages with the expressiveness and refinements of powerful query specification languages.
Additional objects and advantages of the present invention will be apparent from the detailed description of the preferred embodiment thereof, which proceeds with reference to the accompanying drawings.